package com.owen.springboot.smartparkingms.module.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.owen.springboot.smartparkingms.module.sys.entity.UserRole;
import com.owen.springboot.smartparkingms.module.sys.mapper.UserRoleMapper;
import com.owen.springboot.smartparkingms.module.sys.service.IUserRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 用户与角色对应关系 服务实现类
 * </p>
 *
 * @author Owen
 * @since 2022-02-25
 */
@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements IUserRoleService {

    @Resource
    UserRoleMapper userRoleMapper;

    @Override
    public void deleteUserRole(Long userId) {
        QueryWrapper queryWrapper = new QueryWrapper<>()
                .eq("user_id",userId);
        userRoleMapper.delete(queryWrapper);
    }
}
